package com.leilei.controller;

import com.baidu.ueditor.ActionEnter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * Created by yvdedu.com on 2016/11/2.
 */

public class MyServlet extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String rootPath = "target/classes/static";
        resp.setHeader("Content-Type" , "text/html");
        try {
            String exec = new ActionEnter(req, rootPath).exec();
            PrintWriter writer = resp.getWriter();
            writer.write(exec);
            writer.flush();
            writer.close();
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
